<?php

class IndexController extends Zend_Controller_Action{

    public function init(){
    }

    public function indexAction(){
    	$productMapper = new Application_Model_ProductMapper();
    	$specificationMapper = new Application_Model_specificationMapper();
    	$categMapper = new Application_Model_CategoryMapper();
    	$products = $productMapper->fetchAll();
    	$specifications = $specificationMapper->fetchAll();

    		$this->view->contentProducts.= "<table><thead style='font-weight:bold;'>
    				<tr><td>ID</td> <td>Nume</td> <td>Categorie</td>
    				<td>In stoc</td> <td>Pret</td> <td>Locatie Poza</td> <td>Actiuni</td></tr></thead>";

    		 for($i=0; $i<sizeof($products); $i++)
					{ echo '<div>'. $products[$i]->getName().'</div>';
					  echo '<div>'. $products[$i]->getId_category().'</div>';
				      echo '<div>'. $products[$i]->getPicture_location().'</div>';
				      echo '<div>'. $products[$i]->getNbr_pieces().'</div>';
				      echo '<div>'. $products[$i]->getPrice().'</div>';
				    }

			
				    
    		$this->view->contentProducts.= "</table>";
    }
}

